\(\int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx\) [268]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 20 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {x}{2 a}+\frac {\cos (x) \sin (x)}{2 a} \]

[Out]

1/2*x/a+1/2*cos(x)*sin(x)/a

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3254, 2715, 8} \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {x}{2 a}+\frac {\sin (x) \cos (x)}{2 a} \]

[In]

Int[Cos[x]^4/(a - a*Sin[x]^2),x]

[Out]

x/(2*a) + (Cos[x]*Sin[x])/(2*a)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 3254

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \cos ^2(x) \, dx}{a} \\ & = \frac {\cos (x) \sin (x)}{2 a}+\frac {\int 1 \, dx}{2 a} \\ & = \frac {x}{2 a}+\frac {\cos (x) \sin (x)}{2 a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.90 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {\frac {x}{2}+\frac {1}{4} \sin (2 x)}{a} \]

[In]

Integrate[Cos[x]^4/(a - a*Sin[x]^2),x]

[Out]

(x/2 + Sin[2*x]/4)/a

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.70

method result size
parallelrisch \(\frac {2 x +\sin \left (2 x \right )}{4 a}\) \(14\)
risch \(\frac {x}{2 a}+\frac {\sin \left (2 x \right )}{4 a}\) \(17\)
default \(\frac {\frac {\tan \left (x \right )}{2+2 \left (\tan ^{2}\left (x \right )\right )}+\frac {\arctan \left (\tan \left (x \right )\right )}{2}}{a}\) \(23\)
norman \(\frac {\frac {x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{a}-\frac {\tan \left (\frac {x}{2}\right )}{a}+\frac {2 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{a}-\frac {\tan ^{9}\left (\frac {x}{2}\right )}{a}-\frac {x}{2 a}-\frac {3 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2 a}-\frac {x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{a}+\frac {3 x \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {x \left (\tan ^{10}\left (\frac {x}{2}\right )\right )}{2 a}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )}\) \(119\)

[In]

int(cos(x)^4/(a-a*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

1/4*(2*x+sin(2*x))/a

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.60 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {\cos \left (x\right ) \sin \left (x\right ) + x}{2 \, a} \]

[In]

integrate(cos(x)^4/(a-a*sin(x)^2),x, algorithm="fricas")

[Out]

1/2*(cos(x)*sin(x) + x)/a

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (14) = 28\).

Time = 1.45 (sec) , antiderivative size = 153, normalized size of antiderivative = 7.65 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {x \tan ^{4}{\left (\frac {x}{2} \right )}}{2 a \tan ^{4}{\left (\frac {x}{2} \right )} + 4 a \tan ^{2}{\left (\frac {x}{2} \right )} + 2 a} + \frac {2 x \tan ^{2}{\left (\frac {x}{2} \right )}}{2 a \tan ^{4}{\left (\frac {x}{2} \right )} + 4 a \tan ^{2}{\left (\frac {x}{2} \right )} + 2 a} + \frac {x}{2 a \tan ^{4}{\left (\frac {x}{2} \right )} + 4 a \tan ^{2}{\left (\frac {x}{2} \right )} + 2 a} - \frac {2 \tan ^{3}{\left (\frac {x}{2} \right )}}{2 a \tan ^{4}{\left (\frac {x}{2} \right )} + 4 a \tan ^{2}{\left (\frac {x}{2} \right )} + 2 a} + \frac {2 \tan {\left (\frac {x}{2} \right )}}{2 a \tan ^{4}{\left (\frac {x}{2} \right )} + 4 a \tan ^{2}{\left (\frac {x}{2} \right )} + 2 a} \]

[In]

integrate(cos(x)**4/(a-a*sin(x)**2),x)

[Out]

x*tan(x/2)**4/(2*a*tan(x/2)**4 + 4*a*tan(x/2)**2 + 2*a) + 2*x*tan(x/2)**2/(2*a*tan(x/2)**4 + 4*a*tan(x/2)**2 +
 2*a) + x/(2*a*tan(x/2)**4 + 4*a*tan(x/2)**2 + 2*a) - 2*tan(x/2)**3/(2*a*tan(x/2)**4 + 4*a*tan(x/2)**2 + 2*a)
+ 2*tan(x/2)/(2*a*tan(x/2)**4 + 4*a*tan(x/2)**2 + 2*a)

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {x}{2 \, a} + \frac {\tan \left (x\right )}{2 \, {\left (a \tan \left (x\right )^{2} + a\right )}} \]

[In]

integrate(cos(x)^4/(a-a*sin(x)^2),x, algorithm="maxima")

[Out]

1/2*x/a + 1/2*tan(x)/(a*tan(x)^2 + a)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.20 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {\arctan \left (\tan \left (x\right )\right )}{2 \, a} + \frac {\tan \left (x\right )}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )} a} \]

[In]

integrate(cos(x)^4/(a-a*sin(x)^2),x, algorithm="giac")

[Out]

1/2*arctan(tan(x))/a + 1/2*tan(x)/((tan(x)^2 + 1)*a)

Mupad [B] (verification not implemented)

Time = 13.33 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.65 \[ \int \frac {\cos ^4(x)}{a-a \sin ^2(x)} \, dx=\frac {2\,x+\sin \left (2\,x\right )}{4\,a} \]

[In]

int(cos(x)^4/(a - a*sin(x)^2),x)

[Out]

(2*x + sin(2*x))/(4*a)